#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setFocusPolicy(Qt::StrongFocus);
    player = new QMediaPlayer;
    audioOutput = new QAudioOutput;
    player->setAudioOutput(audioOutput);
    connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
    player->setSource(QUrl::fromLocalFile("qrc:/fileofhomework/bgm.mp3"));
    audioOutput->setVolume(0.5);
    player->play();
    }

MainWindow::~MainWindow()
{
    delete option;

}

void MainWindow::on_toolButton_begin_clicked()
{
    choose_level=new levels(nullptr);
    choose_level->show();
}


void MainWindow::on_toolButton_exit_clicked()
{
    close();
}


